﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using XianShang.Data;
using XianShang.Common;
using XianShang.Entity;
using XianShang.Data.DataProvider;

namespace XianShang.Data.DataProvider
{
    public class Remit
    {
        /// <summary>
        /// 在匯款主表中插入一條新數據并返回自增ID值
        /// </summary>
        /// <param name="rbInfo"></param>
        /// <returns></returns>
        public static long AddNewRemitBank(RemitBankInfo rbInfo)
        {
            return DatabaseProvider.GetInstance().AddNewRemitBank(rbInfo);
        }

        /// <summary>
        /// 新增一條數據到（匯款子表_帳號數量）CardAccount
        /// </summary>
        /// <param name="caInfo"></param>
        /// <returns></returns>
        public static int AddNewRemitAccount(RemitAccountInfo raInfo)
        {
            return DatabaseProvider.GetInstance().AddNewRemitAccount(raInfo);
        }
         /// <summary>
        /// 根據ID查找匯款信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static DataTable GetRemitInfoById(string id)
        {
            return DatabaseProvider.GetInstance().GetRemitInfoById(id);
        }

        /// <summary>
        /// 查詢匯款狀態信息
        /// </summary>
        /// <param name="name"></param>
        /// <param name="tel"></param>
        /// <param name="gameAccount"></param>
        /// <param name="bankNum"></param>
        /// <returns></returns>
        public static DataSet GetRemitBankAndRemitAccountInfo(string name, string tel, string gameAccount, string bankNum)
        {
            return DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfo(name, tel, gameAccount, bankNum);
        }
        /// <summary>
        /// 取得總匯款信息
        /// </summary>
        /// <param name="pages">分頁大小</param>
        /// <param name="indexPage">索引頁</param>
        /// <returns></returns>
        public static DataTable GetAllRemitInfo(int pages, int indexPage)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllRemitInfo(), pages, indexPage);
        }
        /// <summary>
        /// 取得總匯款信息
        /// </summary>
        /// <param name="pages">分頁大小</param>
        /// <param name="indexPage">索引頁</param>
        /// <returns></returns>
        public static DataTable GetAllRemitInfo(string area,int pages, int indexPage)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetAllRemitInfo(area), pages, indexPage);
        }
        /// <summary>
        /// 根據實體參數進行查詢
        /// </summary>
        /// <param name="fr"></param>
        /// <param name="SearchType"></param>
        /// <returns></returns>
        public static DataTable GetRemitBankAndRemitAccountInfo(FullRemitInfo fr, int SearchType)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfo(fr, SearchType));
        }
        /// <summary>
        /// 根據實體參數進行查詢
        /// </summary>
        /// <param name="fr"></param>
        /// <param name="SearchType"></param>
        /// <param name="pageSize">分頁大小</param>
        /// <param name="pageIndex">當前頁</param>
        /// <returns></returns>
        public static DataTable GetRemitBankAndRemitAccountInfo(FullRemitInfo fr, int SearchType, int pageSize, int pageIndex)
        {
            return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfo(fr, SearchType), pageSize,  pageIndex);
        }
        /// <summary>
        /// 取得總匯款信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllRemitInfo()
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllRemitInfo());
        }
        /// <summary>
        /// 取得總匯款信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllRemitInfo(string area)
        {
            return Utils.DrToDt(DatabaseProvider.GetInstance().GetAllRemitInfo(area));
        }

        /// <summary>
        /// 更新匯款開通狀態
        /// </summary>
        /// <param name="remitBankId"></param>
        /// <param name="status"></param>
        /// <returns></returns>
       public static int UpRemitBankStatus(string remitBankId, int status)
        {
            return DatabaseProvider.GetInstance().UpRemitBankStatus(remitBankId,status);
        }
       /// <summary>
       /// 根據STATUS和實體參數進行查詢
       /// </summary>
       /// <param name="fr"></param>
       /// <param name="SearchType">查找方式（1精確0模糊）</param>
       /// <returns></returns>
       public static DataTable GetRemitBankAndRemitAccountInfoByStatus(FullRemitInfo fr, int SearchType)
       {
           return Utils.DrToDt(DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfoByStatus(fr,SearchType));
       }
       /// <summary>
       /// 根據STATUS和實體參數進行查詢
       /// </summary>
       /// <param name="fr"></param>
       /// <param name="SearchType">查找方式（1精確0模糊）</param>
       /// <param name="pageSize">分頁大小</param>
       /// <param name="pageIndex">當前頁</param>
       /// <returns></returns>
       public static DataTable GetRemitBankAndRemitAccountInfoByStatus(FullRemitInfo fr, int SearchType,int pageSize, int pageIndex)
       {
           return Utils.LoadDataRows(DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfoByStatus(fr, SearchType),pageSize,pageIndex);
       }
       /// <summary>
       /// 根據STATUS和實體參數進行查詢返回總行數
       /// </summary>
       /// <param name="fr"></param>
       /// <param name="SearchType">查找方式（1精確0模糊）</param>
       /// <returns></returns>
       public static object GetRemitBankAndRemitAccountInfoByStatusCount(FullRemitInfo fr, int SearchType)
       {
           return DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfoByStatusCount(fr,SearchType);
       }

       /// <summary>
       /// 根據實體參數進行查詢返回總行數
       /// </summary>
       /// <param name="fr"></param>
       /// <param name="SearchType">查找方式（1精確0模糊）</param>
       /// <returns></returns>
       public static object GetRemitBankAndRemitAccountInfoCount(FullRemitInfo fr, int SearchType)
       {
           return DatabaseProvider.GetInstance().GetRemitBankAndRemitAccountInfoCount(fr,SearchType);
       }
        /// <summary>
        /// 根據ID更新狀態和處理信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <param name="content"></param>
        /// <returns></returns>
       public static int UpRemitBankStatusAndMessage(string id, string status, string content)
       {
           return DatabaseProvider.GetInstance().UpRemitBankStatusAndMessage(id, status, content);
       }
        /// <summary>
       /// 刪除匯款包括關聯字表記錄
        /// </summary>
        /// <param name="remitId"></param>
        /// <returns></returns>
       public static int DelRemitBankAndRemitAccount(string remitId)
       {
           return DatabaseProvider.GetInstance().DelRemitBankAndRemitAccount(remitId);
       }
    }
}
